3.55 \(\int \sec (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\)

Optimal. Leaf size=103 \[ \frac {2 a^2 (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a^2 (3 A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 A+2 B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {B \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d} \]

[Out]

1/2*a^2*(3*A+2*B)*arctanh(sin(d*x+c))/d+2/3*a^2*(3*A+2*B)*tan(d*x+c)/d+1/6*a^2*(3*A+2*B)*sec(d*x+c)*tan(d*x+c)
/d+1/3*B*(a+a*sec(d*x+c))^2*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {4001, 3788, 3767, 8, 4046, 3770} \[ \frac {2 a^2 (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a^2 (3 A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 A+2 B) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {B \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + a*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

(a^2*(3*A + 2*B)*ArcTanh[Sin[c + d*x]])/(2*d) + (2*a^2*(3*A + 2*B)*Tan[c + d*x])/(3*d) + (a^2*(3*A + 2*B)*Sec[
c + d*x]*Tan[c + d*x])/(6*d) + (B*(a + a*Sec[c + d*x])^2*Tan[c + d*x])/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3788

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Dist[(2*a*b)/
d, Int[(d*Csc[e + f*x])^(n + 1), x], x] + Int[(d*Csc[e + f*x])^n*(a^2 + b^2*Csc[e + f*x]^2), x] /; FreeQ[{a, b
, d, e, f, n}, x]

Rule 4001

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> -Simp[(B*Cot[e + f*x]*(a + b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[(a*B*m + A*b*(m + 1))/(b*(
m + 1)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x], x] /; FreeQ[{a, b, A, B, e, f, m}, x] && NeQ[A*b - a*B,
0] && EqQ[a^2 - b^2, 0] && NeQ[a*B*m + A*b*(m + 1), 0] &&  !LtQ[m, -2^(-1)]

Rule 4046

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> -Simp[(C*Cot[
e + f*x]*(b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[(C*m + A*(m + 1))/(m + 1), Int[(b*Csc[e + f*x])^m, x], x]
/; FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]

Rubi steps

\begin {align*} \int \sec (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx &=\frac {B (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 A+2 B) \int \sec (c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\frac {B (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 A+2 B) \int \sec (c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx+\frac {1}{3} \left (2 a^2 (3 A+2 B)\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {a^2 (3 A+2 B) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {B (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{2} \left (a^2 (3 A+2 B)\right ) \int \sec (c+d x) \, dx-\frac {\left (2 a^2 (3 A+2 B)\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a^2 (3 A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {2 a^2 (3 A+2 B) \tan (c+d x)}{3 d}+\frac {a^2 (3 A+2 B) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {B (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 6.19, size = 481, normalized size = 4.67 \[ \frac {a^2 \cos ^3(c+d x) \sec ^4\left (\frac {1}{2} (c+d x)\right ) (\sec (c+d x)+1)^2 (A+B \sec (c+d x)) \left (\frac {4 (6 A+5 B) \sin \left (\frac {d x}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {4 (6 A+5 B) \sin \left (\frac {d x}{2}\right )}{\left (\sin \left (\frac {c}{2}\right )+\cos \left (\frac {c}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {(3 A+7 B) \cos \left (\frac {c}{2}\right )-(3 A+5 B) \sin \left (\frac {c}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {(3 A+5 B) \sin \left (\frac {c}{2}\right )+(3 A+7 B) \cos \left (\frac {c}{2}\right )}{\left (\sin \left (\frac {c}{2}\right )+\cos \left (\frac {c}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^2}-6 (3 A+2 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 (3 A+2 B) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+\frac {2 B \sin \left (\frac {d x}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {2 B \sin \left (\frac {d x}{2}\right )}{\left (\sin \left (\frac {c}{2}\right )+\cos \left (\frac {c}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^3}\right )}{48 d (A \cos (c+d x)+B)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + a*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

(a^2*Cos[c + d*x]^3*Sec[(c + d*x)/2]^4*(1 + Sec[c + d*x])^2*(A + B*Sec[c + d*x])*(-6*(3*A + 2*B)*Log[Cos[(c +
d*x)/2] - Sin[(c + d*x)/2]] + 6*(3*A + 2*B)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + (2*B*Sin[(d*x)/2])/((Co
s[c/2] - Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^3) + ((3*A + 7*B)*Cos[c/2] - (3*A + 5*B)*Sin[c/2])/((
Cos[c/2] - Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2) + (4*(6*A + 5*B)*Sin[(d*x)/2])/((Cos[c/2] - Sin[
c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) + (2*B*Sin[(d*x)/2])/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] + S
in[(c + d*x)/2])^3) - ((3*A + 7*B)*Cos[c/2] + (3*A + 5*B)*Sin[c/2])/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] +
 Sin[(c + d*x)/2])^2) + (4*(6*A + 5*B)*Sin[(d*x)/2])/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/
2]))))/(48*d*(B + A*Cos[c + d*x]))

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 125, normalized size = 1.21 \[ \frac {3 \, {\left (3 \, A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (3 \, A + 2 \, B\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (6 \, A + 5 \, B\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (A + 2 \, B\right )} a^{2} \cos \left (d x + c\right ) + 2 \, B a^{2}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(3*(3*A + 2*B)*a^2*cos(d*x + c)^3*log(sin(d*x + c) + 1) - 3*(3*A + 2*B)*a^2*cos(d*x + c)^3*log(-sin(d*x +
 c) + 1) + 2*(2*(6*A + 5*B)*a^2*cos(d*x + c)^2 + 3*(A + 2*B)*a^2*cos(d*x + c) + 2*B*a^2)*sin(d*x + c))/(d*cos(
d*x + c)^3)

________________________________________________________________________________________

giac [A]  time = 0.63, size = 178, normalized size = 1.73 \[ \frac {3 \, {\left (3 \, A a^{2} + 2 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (3 \, A a^{2} + 2 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (9 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 24 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

1/6*(3*(3*A*a^2 + 2*B*a^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(3*A*a^2 + 2*B*a^2)*log(abs(tan(1/2*d*x + 1/
2*c) - 1)) - 2*(9*A*a^2*tan(1/2*d*x + 1/2*c)^5 + 6*B*a^2*tan(1/2*d*x + 1/2*c)^5 - 24*A*a^2*tan(1/2*d*x + 1/2*c
)^3 - 16*B*a^2*tan(1/2*d*x + 1/2*c)^3 + 15*A*a^2*tan(1/2*d*x + 1/2*c) + 18*B*a^2*tan(1/2*d*x + 1/2*c))/(tan(1/
2*d*x + 1/2*c)^2 - 1)^3)/d

________________________________________________________________________________________

maple [A]  time = 1.15, size = 141, normalized size = 1.37 \[ \frac {3 a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {5 a^{2} B \tan \left (d x +c \right )}{3 d}+\frac {2 a^{2} A \tan \left (d x +c \right )}{d}+\frac {a^{2} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{d}+\frac {B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a^{2} A \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a^{2} B \left (\sec ^{2}\left (d x +c \right )\right ) \tan \left (d x +c \right )}{3 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)

[Out]

3/2/d*a^2*A*ln(sec(d*x+c)+tan(d*x+c))+5/3*a^2*B*tan(d*x+c)/d+2*a^2*A*tan(d*x+c)/d+a^2*B*sec(d*x+c)*tan(d*x+c)/
d+1/d*B*a^2*ln(sec(d*x+c)+tan(d*x+c))+1/2/d*a^2*A*sec(d*x+c)*tan(d*x+c)+1/3*a^2*B*sec(d*x+c)^2*tan(d*x+c)/d

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 167, normalized size = 1.62 \[ \frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} - 3 \, A a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, B a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 24 \, A a^{2} \tan \left (d x + c\right ) + 12 \, B a^{2} \tan \left (d x + c\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(4*(tan(d*x + c)^3 + 3*tan(d*x + c))*B*a^2 - 3*A*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x +
 c) + 1) + log(sin(d*x + c) - 1)) - 6*B*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log
(sin(d*x + c) - 1)) + 12*A*a^2*log(sec(d*x + c) + tan(d*x + c)) + 24*A*a^2*tan(d*x + c) + 12*B*a^2*tan(d*x + c
))/d

________________________________________________________________________________________

mupad [B]  time = 3.81, size = 145, normalized size = 1.41 \[ \frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,A}{2}+B\right )}{d}-\frac {\left (3\,A\,a^2+2\,B\,a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-8\,A\,a^2-\frac {16\,B\,a^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (5\,A\,a^2+6\,B\,a^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B/cos(c + d*x))*(a + a/cos(c + d*x))^2)/cos(c + d*x),x)

[Out]

(2*a^2*atanh(tan(c/2 + (d*x)/2))*((3*A)/2 + B))/d - (tan(c/2 + (d*x)/2)*(5*A*a^2 + 6*B*a^2) + tan(c/2 + (d*x)/
2)^5*(3*A*a^2 + 2*B*a^2) - tan(c/2 + (d*x)/2)^3*(8*A*a^2 + (16*B*a^2)/3))/(d*(3*tan(c/2 + (d*x)/2)^2 - 3*tan(c
/2 + (d*x)/2)^4 + tan(c/2 + (d*x)/2)^6 - 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int A \sec {\left (c + d x \right )}\, dx + \int 2 A \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 B \sec ^{3}{\left (c + d x \right )}\, dx + \int B \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+a*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)

[Out]

a**2*(Integral(A*sec(c + d*x), x) + Integral(2*A*sec(c + d*x)**2, x) + Integral(A*sec(c + d*x)**3, x) + Integr
al(B*sec(c + d*x)**2, x) + Integral(2*B*sec(c + d*x)**3, x) + Integral(B*sec(c + d*x)**4, x))

________________________________________________________________________________________